<?php 
include 'common.php';
$cc = "SELECT * FROM config ORDER BY id ASC";
$row_123 = select($cc,$DB);
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title><?php echo $row_123[0]['title'] ?></title>
	<link href="<?=$website['public'];?>/web/base.css" rel="stylesheet" type="text/css"/>
	<link href="<?=$website['public'];?>/web/node.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="top">
	<div class="auto">
		<div class="nav">
			<img src="<?=$website['public'];?>/web/img/logo.png" style="width:30px; height:25px;margin:13px;" />
			<a href="../index.php">首页</a>
			<a href="/web/discus.php">讨论</a>
			<a href="/web/answers.php">问答</a>
			<a href="/web/node.php">节点</a>
			<a href="/web/tag.php">标签</a>
			<input type="text" name="name" placeholder="搜索" autocomplete="off" class="input">
			<div class="login right"><?php if ($_COOKIE['name']) {
				echo ($_COOKIE['name']);
			?>
			<a href="/web/logout.php?logout=1">退出登录</a>
			<?php
			} else { ?>
			<a href="/web/login.php">登录</a>
			<?php
			}
			 ?></div>
		</div>
	</div>
</div>
<div class="main fn-clear">
	<div class="bigbj auto">
		<div class="bg_l left">
			<div class="panel">
				<?php
					$sql = "SELECT * FROM zone ORDER BY id ASC";
					$row = select($sql,$DB);
					foreach ($row as $key => $value) { 
				?>
					<div class="gf"><?php echo $value['Area'] ?></div>
					<ul class="am_list">
						<?php 
							$sql = "SELECT * FROM version WHERE zone_id = '{$value['id']}'";
							$row = select($sql,$DB);
							foreach ($row as $key => $value) { 
								$count = "SELECT COUNT(*) FROM publish WHERE area = '{$value['id']}'";
								$number = select($count,$DB);
						?>
							<li class="list">
								<div class="nameber right"><?php echo $number[0]['COUNT(*)']; ?></div>
								<div class="img left">
									<img src="<?=$website['public'];?>/web/img/node.png">
								</div>
								<div class="infor">
									<div class="cx-send left"><a href="../index.php?id=<?php echo $value['id']?>"><?php echo $value['AdvancedEdu'] ?></a></div>
									<div class="info-desc left"><?php if(empty($value['introduce'])){
								echo "简介 : 无";
							}else{
								echo $value['introduce'];
							} ?>
							</div>
									<div class="banzhu left"><?php if(empty($value['custodian'])){
								echo "版主 : 无";
							}else{
								echo $value['custodian'];
							} ?></div>
								</div>
							</li>
						<?php } ?>
					</ul>
				<?php } ?>
			</div>
		</div>
		<div class="bg_r right">
			<div class="one_box">
				<div class="bq">标签列表</div>
			</div>
			<div class="two_box">
				<div class="bq">热门话题</div>
			</div>
			<div class="one_box">
				<div class="bq">精华话题</div>
			</div>
		</div>
	</div>
</div>
<div class="bottom"><?php echo $row_123[0]['ICP'] ?></div>
</body>
</html>